package sunwul.hospital.hosp.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import sunwul.hospital.common.result.Result;
import sunwul.hospital.hosp.service.DepartmentService;
import sunwul.hospital.model.vo.hosp.DepartmentVo;

import java.util.List;

/**
 * @author sunwul
 * @date 2023/11/9 21:43:28
 * @description
 */
@Api(tags = "科室信息管理")
@RestController
@RequestMapping("admin/hosp/hospital")
public class DepartmentController {

    @Autowired
    DepartmentService departmentService;

    @ApiOperation(value = "查询医院下的所有科室列表")
    @GetMapping("/getDeptList/{hoscode}")
    public Result getDepartmentList(@PathVariable String hoscode){
        List<DepartmentVo> departmentVos = departmentService.findDeptTree(hoscode);
        return Result.ok(departmentVos);
    }
}
